package top.zywork.enums;

import lombok.Getter;
import top.zywork.strategy.order.DeliveryOrderService;
import top.zywork.strategy.order.GraphicOrderStrategyService;
import top.zywork.strategy.order.MallOrderService;

/**
 * 控制微小服务的订单保存
 * @author Animo
 * @Date 2020/10/21
 * @Blog http://www.ljyanimo.com
 */
@Getter
public enum PayOrderEnum {

    KDDN("kddn","快递代拿下单", DeliveryOrderService.class),
    MALL("mall","商城下单", MallOrderService.class),
    DY("dy","打印下单", GraphicOrderStrategyService.class);

    private String name;

    private String des;

    private Class clazz;

    PayOrderEnum(String name, String des,Class clazz) {
        this.name = name;
        this.des = des;
        this.clazz = clazz;
    }

    public static PayOrderEnum getEnum(String name){
        PayOrderEnum[] values = PayOrderEnum.values();
        for(PayOrderEnum payOrderEnum : values){
            if(payOrderEnum.getName().equals(name)){
                return payOrderEnum;
            }
        }
        return null;
    }


}
